<?php exit;

if($tid > 0) {
    $theadext_table = $ghx_cache->get_share_var(VAR_THREADEXT_TB);
    //删除关联标签:
    $clearLabelogRet = ClearLabelLogFor($tid, 'thread');
    $threadext_data = db_find_one($theadext_table, array('tid' => $tid));
    $r2 = FALSE;
    if (!empty($threadext_data))
        $r2 = db_delete($theadext_table, array('tid' => $tid));
    $delextfile = true;
    if ($r2 != FALSE && !empty($threadext_data)) {
        $firstimg = $threadext_data['firstimg'];
        if (!empty($firstimg)) {
            if (IsKindredHost($firstimg)) {
                $hp1 = stripos($firstimg, 'http://');
                if ($hp1 !== 0) $hp1 = stripos($firstimg, 'https://');
                if ($hp1 === 0) {
                    $hp2 = strpos($firstimg, '/', 10);
                    if ($hp2 > 10) {
                        $firstimg = substr($firstimg, $hp2 + 1);
                    }
                }
                if (file_exists($firstimg))
                    $delextfile = @unlink($firstimg);
            }
        }
    }
}